Use pm_arguments_end for function call#3634
Merged
Merged
Conversation
Previously, the location of CallNode was incorrect when it accepts a
block parameter:
```
$ ruby -rprism -e 'pp Prism.parse("foo(&blk)").value.statements.body[0]']
@ CallNode (location: (1,0)-(1,8)) # <=== It should be (1,0)-(1,9)
├── flags: ∅
├── receiver: ∅
├── call_operator_loc: ∅
├── name: :foo
├── message_loc: (1,0)-(1,3) = "foo"
├── opening_loc: (1,3)-(1,4) = "("
├── arguments: ∅
├── closing_loc: (1,8)-(1,9) = ")"
*snip*
$ ruby -rprism -e 'pp Prism.parse("foo(&blk)").value.statements.body[0].slice'
"foo(&blk"
```
Note that the slice lacks the closing parenthesis.
mame
force-pushed
the
fix-CallNode-range-with-block-param
branch
from
September 8, 2025 03:19
e6ab4f1 to
3c22e6f
Compare
Member
Author
|
By the way, the AST design of |
kddnewton
approved these changes
Sep 11, 2025
Collaborator
Originally that was the design, but we got feedback early on that it was much easier to reason about call nodes when all of the blocks were in the same place. |
Member
|
Regarding BlockArgumentNode, see discussion in #1310 and linked issues/PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the location of CallNode was incorrect when it accepts a block parameter:
Note that the slice lacks the closing parenthesis.